Telegram Group & Telegram Channel
Если у вас есть массив, в каждом элементе которого есть computed, то лучше создать один на весь массив, чем много для каждого элемента

// Bad
const rows = productRows.map(row => ({
...row,
total: computed(() => row.price * row.qty),
}));


// Good
const computedRows = computed(() =>
productRows.map(row => ({
...row,
total: row.price * row.qty,
}))
);


#tip #performance #reactivity



tg-me.com/vuefaq/1165
Create:
Last Update:

Если у вас есть массив, в каждом элементе которого есть computed, то лучше создать один на весь массив, чем много для каждого элемента

// Bad
const rows = productRows.map(row => ({
...row,
total: computed(() => row.price * row.qty),
}));


// Good
const computedRows = computed(() =>
productRows.map(row => ({
...row,
total: row.price * row.qty,
}))
);


#tip #performance #reactivity

BY Vue-FAQ




Share with your friend now:
tg-me.com/vuefaq/1165

View MORE
Open in Telegram


Vue FAQ Telegram | DID YOU KNOW?

Date: |

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.

Vue FAQ from ms


Telegram Vue-FAQ
FROM USA